
package cn.ruituo.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LogUtil {
    //private static boolean throwExe=false;
    public  static final Logger Log= LoggerFactory.getLogger(LogUtil.class);
    private LogUtil(){}

    public static void debug(Object msg){
        if(Log.isDebugEnabled())
            Log.debug(String.valueOf(msg));
    }
    public static void debug(String msg,Exception e){
        if(Log.isDebugEnabled())
            Log.debug(msg,e);
    }
    public static void info(Object msg){
            Log.info(String.valueOf(msg));
    }
    public static void info(String msg,Exception e){
            Log.info(msg,e);
    }
    public static void error(String msg){
        Log.error(msg);
    }
    public static void error(String msg,Exception e){
        Log.error(msg,e);
    }

    public static void handler(Exception e){
        Log.error(e.getMessage(),e);
        //if(throwExe){
        //    throw new RuntimeException(e);
       // }
    }
    public static void handler(RuntimeException e){
        Log.error(e.getMessage(),e);
        //if(throwExe){
        //    throw  e;
        //}
    }
}

